<?php
header('Content-type:text/html;charset=utf-8');
session_start();
include_once 'dbconfig.php';
include_once 'common.php';

if ($_GET) {
    if (isset($_GET['getType']) && $_GET['getType'] == 'getLoginUser') {
        if (isset($_SESSION['loginUserName'])) {
            $name = $_SESSION['loginUserName'];
            $selectNickeName = 'select * from user where userName = "' . $name . '"';
            $res = getSelectArr($selectNickeName);
            if (count($res) > 0) {
                $name = $res[0]['nickName'] ? $res[0]['nickName'] : $name;
            }
            $msg = ['msg' => $name, 'status' => 1];
        } else {
            $msg = ['msg' => '请登录！', 'status' => 0];
        }
        responseEvent($msg);
    }
}